package cn.molu.jsoup.util;

/**
 * @author 陌路
 * @apiNote 资源链接地址
 * @date 2024/1/16 13:59
 * @tool Created by IntelliJ IDEA
 */
public interface UrlConstant {
    /*******************【PC端】********************/
    // %E7%BE%8E%E5%A5%B3
    public static final String PC_URL_QUERY_BY_KEYWORD = "https://pic.sogou.com/pics?query=";

    // %E6%B2%B3%E6%B5%81
    public static final String PC_URL_MODE_QUERY_BY_KEYWORD = "https://pic.sogou.com/pics?mode=%s&query=%s";

    public static final String PC_URL_JSP_QUERY_BY_KEYWORD = "https://pic.sogou.com/pic/searchList.jsp?from=homeHotSearch&rcer=&spver=0&keyword=";


    /*******************【移动端】********************/
    public static final String APP_URL_INDEX = "https://pic.sogou.com/pic/index.jsp?v=5";
    // %E7%BE%8E%E5%A5%B3%E5%A3%81%E7%BA%B8
    public static final String APP_URL_QUERY_BY_KEYWORD = "https://pic.sogou.com/pic/searchList.jsp?from=homeHotSearch&rcer=&spver=0&keyword=";

    public static final String APP_BASE_URL = "https://pic.sogou.com/pic/searchList.jsp?from=homeHotSearch&rcer=&spver=0&tagQSign=%E9%AB%98%E6%B8%85,3636d5ad&showMode=0&routeName=searchlist&keyword=";


    default String getPCUrlQueryByKeyword(final String keyword) {
        return PC_URL_QUERY_BY_KEYWORD + keyword;
    }

    default String getAPPUrlQueryByKeyword(final String keyword) {
        return APP_URL_QUERY_BY_KEYWORD + keyword;
    }

    default String getPCUrlModeQueryByKeyword(final String mode, final String keyword) {
        return String.format(PC_URL_MODE_QUERY_BY_KEYWORD, mode, keyword);
    }

    default String getPcUrlJspQueryByKeyword(final String keyword) {
        return PC_URL_JSP_QUERY_BY_KEYWORD + keyword;
    }
}
